{load header}
<!--/H-->

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
        <!-- nav --><!-- nav -->
            
	<div class="main-title">
		<h2>新增BANNER图片</h2>
	</div>
	
	<form action="" method="post" class="form-horizontal" enctype="multipart/form-data" >
            <div class="form-item">
                <input name="id" value="{$item['id']}" type="hidden">
			<label class="item-label">BANNER图片类型<span class="check-tips"></span></label>
			<div class="controls">
                            <select name="type">
                                <option {if $item['type'] == 1} selected {/if} value="1">PC端-金融</option>
                                <option {if $item['type'] == 2} selected {/if} value="2">移动-社区</option>
                                <option {if $item['type'] == 3} selected {/if} value="3">众筹</option>
                                <option {if $item['type'] == 4} selected {/if} value="4">PC端-社区</option>
                                <option {if $item['type'] == 5} selected {/if} value="5">微信-社区</option>
                                <option {if $item['type'] == 6} selected {/if} value="6">IOS-贷款</option>
                                <option {if $item['type'] == 7} selected {/if} value="7">安卓-贷款</option>
								<option {if $item['type'] == 8} selected {/if} value="8">移动-任务</option>
								<option {if $item['type'] == 9} selected {/if}  value="9">溜溜无忧banner</option>
                            </select>
			</div>
		</div>
            <div class="form-item">
			<label class="item-label">LOGO<span class="check-tips">（可以空，用于前台显示，请上传规格统一的图片）</span></label>
			<div class="controls">
				<input type="file" id="upload_picture_cover_id">
                                <input type="hidden" name="banner_img" id="cover_id_cover_id" value="{$item['banner_img']}"/>
				<div class="upload-img-box"><!--{if ($item['banner_img']!='')}--><div class="upload-pre-item"><img src="{$item['banner_img']}"/></div><!--{/if}--></div>
			</div>
			<script type="text/javascript" src="{eval echo base_url()}static/uploadify/jquery.uploadify.min.js"></script>
			<script type="text/javascript">
			//上传图片
			/* 初始化上传插件 */
			$("#upload_picture_cover_id").uploadify({
				"height"          : 30,
				"swf"             : "{eval echo base_url()}static/uploadify/uploadify.swf",
				"fileObjName"     : "picture",
				"buttonText"      : "上传图片",
				"uploader"        : "http://static.tan66.com/upload/banner.html",//
				//'formData' : {"action": "upload", "sid" : ""},
				"width"           : 120,
				'removeTimeout'	  : 1,
				'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
				"onUploadSuccess" : uploadPicturecover_id,
				'onFallback' : function() {
					alert('未检测到兼容版本的Flash.');
				}
			});
			function uploadPicturecover_id(file, data){
				var data = $.parseJSON(data);
				var src = '';
				if(data.status){
					$("#cover_id_cover_id").val(data.id);
					src = data.url || '' + data.path
					$("#cover_id_cover_id").parent().find('.upload-img-box').html(
						'<div class="upload-pre-item"><img src="' + src + '"/></div>'
					);
				} else {
					updateAlert(data.info);
					setTimeout(function(){
						$('#top-alert').find('button').click();
						//$(that).removeClass('disabled').prop('disabled',false);
					},1500);
				}
			}
			</script>
		</div>
            <div class="form-item">
			<label class="item-label">图片标题<span class="check-tips">（手机端显示）</span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="title" value="{$item['title']}">
			</div>
		</div>
            <div class="form-item">
			<label class="item-label">网站地址<span class="check-tips"></span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="banner_link" value="{$item['banner_link']}">
			</div>
		</div>
		
		<div class="form-item">
			<label class="item-label">排序<span class="check-tips"></span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="sort" value="{$item['sort']}">
			</div>
		</div>
		
       	<div class="form-item">
            <label class="item-label">是否显示<span class="check-tips">（启用后才能在首页显示）</span></label>
            <div class="controls">
                <label class="radio"><input type="radio" <!--{if ($item['status']=='1')}--> checked<!--{/if}-->  name="status" value="1"  />是</label>
                <label class="radio"><input type="radio" <!--{if ($item['status']=='0')}--> checked<!--{/if}-->  name="status" value="0">否</label>
            </div>
        </div>
        
		
		<div class="form-item">
			<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
			<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
		</div>
	</form>

<!--F-->{load footer}